package com.zqx.strategy.context;

import com.zqx.strategy.abstractstrategy.Discount;

/**
 * description: 环境类
 * @author zqx
 * @date 2018/09/04
 */
public class MovieTicket {

    private double price;
    private Discount discount;//维持一个对抽象折扣类的引用

    public double getPrice() {
        return discount.calculate(this.price);
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setDiscount(Discount discount){
        this.discount = discount;
    }
}
